package com.cencat.order.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 订单支付VO
 * @author cencat
 * @description 固定商家场景多租户SaaS企业综合管理系统订单支付VO
 * @since 2024-01-01
 */
@Data
@Accessors(chain = true)
@Schema(name = "OrderPaymentVO", description = "订单支付VO")
public class OrderPaymentVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "支付方式：ALIPAY-支付宝，WECHAT-微信支付，BANK_CARD-银行卡，CASH-现金")
    @NotBlank(message = "支付方式不能为空")
    @Pattern(regexp = "^(ALIPAY|WECHAT|BANK_CARD|CASH)$", message = "支付方式不正确")
    private String paymentMethod;

    @Schema(description = "支付流水号")
    @NotBlank(message = "支付流水号不能为空")
    @Size(max = 100, message = "支付流水号长度不能超过100个字符")
    private String paymentNo;

    @Schema(description = "实付金额")
    @NotNull(message = "实付金额不能为空")
    @DecimalMin(value = "0.01", message = "实付金额必须大于0")
    @Digits(integer = 10, fraction = 2, message = "实付金额格式不正确")
    private BigDecimal paidAmount;

    @Schema(description = "支付渠道：ONLINE-线上支付，OFFLINE-线下支付")
    @Pattern(regexp = "^(ONLINE|OFFLINE)$", message = "支付渠道不正确")
    private String paymentChannel;

    @Schema(description = "支付账户")
    @Size(max = 100, message = "支付账户长度不能超过100个字符")
    private String paymentAccount;

    @Schema(description = "支付银行")
    @Size(max = 100, message = "支付银行长度不能超过100个字符")
    private String paymentBank;

    @Schema(description = "支付备注")
    @Size(max = 500, message = "支付备注长度不能超过500个字符")
    private String paymentRemark;

    @Schema(description = "第三方支付平台订单号")
    @Size(max = 100, message = "第三方支付平台订单号长度不能超过100个字符")
    private String thirdPartyOrderNo;

    @Schema(description = "第三方支付平台交易号")
    @Size(max = 100, message = "第三方支付平台交易号长度不能超过100个字符")
    private String thirdPartyTradeNo;

    @Schema(description = "支付手续费")
    @DecimalMin(value = "0.00", message = "支付手续费不能为负数")
    @Digits(integer = 10, fraction = 2, message = "支付手续费格式不正确")
    private BigDecimal paymentFee;

    @Schema(description = "支付优惠金额")
    @DecimalMin(value = "0.00", message = "支付优惠金额不能为负数")
    @Digits(integer = 10, fraction = 2, message = "支付优惠金额格式不正确")
    private BigDecimal paymentDiscount;

    @Schema(description = "支付IP地址")
    @Size(max = 50, message = "支付IP地址长度不能超过50个字符")
    private String paymentIp;

    @Schema(description = "支付设备信息")
    @Size(max = 200, message = "支付设备信息长度不能超过200个字符")
    private String paymentDevice;

    @Schema(description = "支付位置信息")
    @Size(max = 200, message = "支付位置信息长度不能超过200个字符")
    private String paymentLocation;
}